package action;

import java.util.List;

import vo.Book;
import vo.Student;
import dao.BookDao;
import dao.LendDao;

public class Lendaction {
	int bookid;
	String test;
	String lendid;
	List listbook;
	private LendDao lenddao;
	private BookDao bookDao;

	public List getListbook() {
		return listbook;
	}

	public void setListbook(List listbook) {
		this.listbook = listbook;
	}

	public void setBookDao(BookDao bookDao) {
		this.bookDao = bookDao;
	}

	public void setLenddao(LendDao lenddao) {
		this.lenddao = lenddao;
	}

	public int getBookid() {
		return bookid;
	}

	public void setBookid(int bookid) {
		this.bookid = bookid;
	}

	public String getLendid() {
		return lendid;
	}

	public void setLendid(String lendid) {
		this.lendid = lendid;
	}

	public String getTest() {
		return test;
	}

	public void setTest(String test) {
		this.test = test;
	}

	public String lendd(){
		listbook = bookDao.selectAllBook();
		Book book= new Book();
		Student student= new Student();
		book.setId(bookid);
		student.setReaderId(test);
		lenddao.addLend(book, student);
		return "func1";
	}
	
	public String huang(){
	lenddao.deleteBook(lendid);
	return "func1";
}
}
